//
//  Player.m
//  OC1_类和对象课后作业
//
//  Created by dllo on 15/10/22.
//  Copyright (c) 2015年 dllo. All rights reserved.
//

#import "Player.h"

@implementation Player

-(id)init
{

    _name = @"Iverson";
    _sex = @"male";
    _age = 35;
    _event = @"basketball";
    [self info];
    return self;

}

-(void)info
{

    NSLog(@"%@ %@ %ld %@", _name, _sex, _age, _event);

}

-(void)play
{

    NSLog(@"%@在%ld时接受职业%@训练", _name, _age, _event);

}

-(NSString *)name;
{
    return _name;
}

-(void)setName:(NSString *)name;
{
    _name = name;
}
-(NSString *)sex;
{
    return _sex;
}
-(void)setSex:(NSString *)sex;
{
    _sex = sex;
}
-(NSInteger)age;
{
    return _age;
}
-(void)setAge:(NSInteger)age;
{
    _age = age;
}
-(NSString *)event;
{
    return _event;
}
-(void)setEvent:(NSString *)event;
{
    _event = event;
}
-(id)initWithName:(NSString *)name sex:(NSString *)sex age:(NSInteger)age event:(NSString *)event;
{
    _name = name;
    _sex = sex;
    _age = age;
    _event = event;
    return self;
}

+ (id)playerWithName:(NSString *)name sex:(NSString *)sex age:(NSInteger)age event:(NSString *)event

{
    Player *p = [[Player alloc] initWithName:name sex:sex age:age event:event];
    return p;
}


@end
